import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames';
import { mainHandle } from '@common/mainIpc';
import {
  getVideoMarkListByVedioId,
  getRightMarkListByVideoId,
  deleteMarkInfo,
  addMarkItemInfo,
} from '@main/core/sqlite/modules/time_mark_and_annotation';

export default () => {
  //获取视频标注列表
  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.getVideoMarkListByVedioId, async (data: any) => {
    return await getVideoMarkListByVedioId(data.params.id);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.getRightMarkListByVideoId, async (data: any) => {
    return await getRightMarkListByVideoId(data.params.id);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.deleteMarkInfo, async (data: any) => {
    return await deleteMarkInfo(data.params);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.addMarkItemInfo, async (data: any) => {
    return await addMarkItemInfo(data.params);
  });
};
